﻿using MTQ.BLL;
using MTQ.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MTQ.Web.Controllers
{
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = false)]
    public class AdminLayoutAttribute : ActionFilterAttribute
    {
        public override void OnResultExecuting(ResultExecutingContext filterContext)
        {
            //顶部菜单
            ((ViewResult)filterContext.Result).ViewBag.LoginName = "Admin";

            //this.System.Web.Mvc.ControllerBase; 

            //List<Guid> obj = Helpers.SessionHelper.GetSessionListMenu(filterContext.Controller);
           
            //左侧菜单
            //((ViewResult)filterContext.Result).ViewBag.SidebarMenuModel = new Base_MenuService().InitSidebarMenu(null, obj);

            //var user = Helpers.SessionHelper.GetCurrentUser();
            //object obj =  Session["CurrentUser"];
            //if (obj == null)
            //{
            //}
            //if (user != null)
            //{
            //    //顶部菜单
            //    ((ViewResult)filterContext.Result).ViewBag.LoginName = user.LoginName;
            //    //左侧菜单
            //    ((ViewResult)filterContext.Result).ViewBag.SidebarMenuModel = InitSidebarMenu(user);
            //    //面包屑
            //    //((ViewResult)filterContext.Result).ViewBag.BreadCrumbModel = InitBreadCrumb(filterContext);
            //}
        }



    }
}
